package com.yuyou.activity.comm.service.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yuyou.activity.comm.service.entity.PayRefundNoticeTrade;
import com.yuyou.activity.comm.service.mapper.PayRefundNoticeTradeMapper;
import com.yuyou.activity.comm.service.service.IPayRefundNoticeTradeService;
import com.yuyou.activity.util.bean.ResBoolSimpleInfo;
import com.yuyou.activity.util.util.Sequence;

@Service
public class PayRefundNoticeTradeServiceImpl implements IPayRefundNoticeTradeService{

	@Autowired
	private PayRefundNoticeTradeMapper payRefundNoticeTradeMapper;

	@Override
	public int deleteByPrimaryKey(Long payRefundNoticeTradeId) {
		return payRefundNoticeTradeMapper.deleteByPrimaryKey(payRefundNoticeTradeId);
	}

	@Override
	public int insert(PayRefundNoticeTrade record) {
		record.setPayRefundNoticeTradeId(Sequence.getSequence().nextId());
		record.setCreateTime(new Date());
		return payRefundNoticeTradeMapper.insert(record);
	}

	@Override
	public PayRefundNoticeTrade selectByPrimaryKey(Long payRefundNoticeTradeId) {
		return payRefundNoticeTradeMapper.selectByPrimaryKey(payRefundNoticeTradeId);
	}

	@Override
	public int updateByPrimaryKeySelective(PayRefundNoticeTrade record) {
		return payRefundNoticeTradeMapper.updateByPrimaryKeySelective(record);
	}
	
	@Override
	public ResBoolSimpleInfo<String> add(PayRefundNoticeTrade record) {
		this.insert(record);
		return ResBoolSimpleInfo.getSuccessInfo();
	}

}
